package com.java.Enum;

/**
 * @Author: ZhangJin
 * @Date: 2020/9/5 16:56
 */
public enum PopularityAnalysis {

    // TODO: 2020/9/5   受关注程度枚举

    Popularity1("4","很受欢迎"),

    Popularity2("3","比较受欢迎"),

    Popularity3("2","一般"),

    Popularity4("1","不受欢迎");

    private String Index;

    private String Explain;
    PopularityAnalysis(String Index,String Explain) {
        this.Index = Index;
        this.Explain = Explain;
    }

    public String getIndex() {
        return Index;
    }

    public String getExplain() {
        return Explain;
    }

    public static PopularityAnalysis getPopularity(String Explain) {

        if (Explain.equals("很受欢迎"))
            return Popularity1;
        if (Explain.equals("比较受欢迎"))
            return Popularity2;
        if (Explain.equals("一般"))
            return Popularity3;
        if (Explain.equals("不受欢迎"))
            return Popularity4;
        // TODO: 2020/9/5   默认选取 比较受欢迎
        return Popularity2;

    }
    public static String getExplain(String Index) {

        if (Index.equals("4"))
            return Popularity1.getExplain();
        if (Index.equals("3"))
            return Popularity2.getExplain();
        if (Index.equals("2"))
            return Popularity3.getExplain();
        if (Index.equals("1"))
            return Popularity4.getExplain();
        // TODO: 2020/9/5   默认选取 比较受欢迎
        return Popularity2.getExplain();

    }
}
